<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>档案管理系统</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="/static/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/static/dist/css/skins/all-skins.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-treeview.css">
    <link rel="stylesheet" href="/static/css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="/static/plugins/datepicker/datepicker3.css">
    <link rel="stylesheet" href="/static/layer/theme/default/layer.css">
    <link rel="stylesheet" href="/static/css/fileinput.min.css">
    <link rel="stylesheet" href="/static/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="/static/webCss/dabl.css?v=shujubuwqd12138">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="/static/plugins/ie9/html5shiv.min.js"></script>
    <script src="/static/plugins/ie9/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue"  style="font-size: medium">
        <div class="content row" id="lxgl">
            <div class="modal" id="filesModal" data-backdrop="static">
                <div class="modal-dialog" style="height: 500px">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title">上传文件夹</h4>
                        </div>
                        <div class="modal-body">
                            <div class="input-group">
                                <div class="custom-file">
                                    <input @change="filesChange" id="fileUpload" type="file" multiple webkitdirectory class="custom-file-input" ref="fileUpload">
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
                            <button @click.prevent="doUploadFiles" type="submit" class="btn btn-primary" :disabled="zzsc" style="background-color: #2C75E8">上传该文件夹</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>

            <div class="modal" id="selectModal" data-backdrop="static">
                <div class="modal-dialog" style="height: 500px">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title">请选择要录入类型</h4>
                        </div>
                        <div class="modal-body">
                            <select class="form-control" v-model="kjlx">
                                <option value="0">历史、公建、工业、开发...</option>
                                <option value="1">个人用房</option>
                            </select>
                        </div>
                        <div class="modal-footer">
                            <div class="text-center">
                                <button @click.prevent="kjlxClick" type="submit" class="btn btn-primary" style="background-color: #2C75E8">确定</button>
                            </div>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>

            <div class="modal" id="lxxzModal" data-backdrop="static" >
                <div class="modal-dialog" style="height: 500px;overflow: auto">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title">选择档案类型</h4>
                        </div>
                        <div class="modal-body">
                            <div id="lxTree"></div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default pull-left" data-dismiss="modal" @click="close">关闭</button>
                            <button @click="sureLxSelect" type="button" class="btn btn-primary">确认选择</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>

            <div class="modal" id="shrModal" data-backdrop="static">
                <div class="modal-dialog" style="height: 500px">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title">选择审核人</h4>
                        </div>
                        <div class="modal-body">
                            <span aria-hidden="true">审核人：</span></button>
                            <select v-model="shr">
                                <option v-for="(v,k) in shrs" :value="v.id" >{{v.name}}</option>
                            </select>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default pull-left" data-dismiss="modal" @click="closeshr">关闭</button>
                            <button @click.prevent="sureSelect" type="button" class="btn btn-primary" style="background-color: #2C75E8">确认选择</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            <div class=" row" style="margin-top: -20px">
                <div class="nav-tabs-custom box-body">
                    <ul class="nav nav-tabs pull-right">
                        <button class="btn btn-primary" style="float: right;height: 25px;width:111px;border-radius: 2px;background-color: #2C75E8;padding-top: 2px;font-family: 'PingFang SC';margin-top: 9px;margin-right: 23px" @click="daxxlr">档案信息录入</button>
                        <li @click="kjtab" style="float: left" class="active"><a href="#kjdabr" data-toggle="tab">科技档案补录</a></li>
                        <li @click="wstab" style="float: left"><a href="#wsdabr" data-toggle="tab">文书档案补录</a></li>
                    </ul>
                    <div class="tab-content no-padding">
                        <div class="tab-pane active" id="kjdabr">
                        </div>
                        <div class="tab-pane" id="wsdabr" style="position: relative;overflow: auto;padding: 0px">
                        </div>
                    </div>
                </div>
                <table class="table table-no-bordered table-hover text-center" id="userTable" data-classes="table table-no-border">

                </table>
            </div>
        </div>

<script src="/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<!-- Slimscroll -->
<script src="/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="/static/plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="/static/dist/js/app.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="/static/dist/js/demo.js"></script>
<!--tabs-->
<script src="/static/dist/js/app_iframe.js"></script>
<script src="/static/js/bootstrap-treeview.js"></script>
<script src="/static/js/bootstrapValidator.min.js"></script>
<script src="/static/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="/static/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="/static/js/vue.js"></script>

<script src="/static/js/vue-resource.min.js"></script>
        <script src="/static/layer/layer.js"></script>
<script src="/static/js/myJs.js?v=shujubuwqd12138"></script>
<script src="/static/js/fileinput.min.js"></script>
<script src="/static/js/bootstrap-table.min.js"></script>
<script src="/static/js/bootstrap-table-zh-CN.js"></script>
        <script src="/static/js/newJs.js?v=shujubuwqd12138"></script>


<script type="text/javascript">
    newCss("/static/webCss/dabl.css");
    var pageNum = 1;
    var pageSize = 5;
    var sortOrder = "desc";
    function paramsMatter(value,row,index) {
        var span=document.createElement('span');
        span.setAttribute('title',value);
        span.innerHTML = value;
        return span.outerHTML;
    }

    function clsc(dalxText,dabh) {
        vue.$data.dalxText = dalxText;
        vue.$data.clxx.dabh = dabh;
        var bh = dabh;
        var datas = bh.split("-");
        var code = datas[0];
        code = datas[0].substring(0,code.length-4)
        vue.$http.get('/dagl/api/queryCode?code='+code).then( function (result) {
            var data = result.body;
            if (data.code == 200) {
                vue.$data.dalxText = data.data.dalxName;

            }else{
                cxAlert("该编号不符合要求");
                this.gdxx.dabh = null;
            }
        });
        $('#filesModal').modal('show');
    }

    function clxxlr(dabh,id) {
        vue.$http.get('/dagl/api/queryKjWsFlag?dabh='+dabh).then(function (res) {
            var data = res.body;
            if(data.code == 200){
                if(data.data === 1){
                    top.addTabs({
                        id: "19001115",
                        text: "档案录入",
                        icon: "fa fa-tasks",
                        url: "kjdalr?dabh="+dabh+"&type="+0+"&id="+id+"&pageNum="+pageNum+"&pageSize="+pageSize,
                        targetType: "iframe-tab",
                        close:true,
                    });
                }else if(data.data === 3){
                    top.addTabs({
                        id: "19001116",
                        text: "档案录入",
                        icon: "fa fa-tasks",
                        url: "wsdalr?dabh="+dabh+"&type="+0+"&id="+id,
                        targetType: "iframe-tab",
                        close:true,
                    });
                }else {
                    top.addTabs({
                        id: "190011151",
                        text: "档案录入",
                        icon: "fa fa-tasks",
                        url: "gryflr?dabh="+dabh+"&type="+0+"&id="+id+"&pageNum="+pageNum+"&pageSize="+pageSize,
                        targetType: "iframe-tab",
                        close:true,
                    });
                }
            }
        })
    }

    //作废
    function zf(id){
        var url;
        url = '/dalr/api/rgaudit?id='+id+'&flag='+3;
        var myMsg = cxLoad("作废中");
        vue.$http.get(url).then( function (result) {
            parent.refresh();
            var data = result.body;
            if(data.code == 200){
                layer.close(myMsg);
                cxAlertOk("废弃成功");
                $("#userTable").bootstrapTable('destroy');
                $('#userTable').bootstrapTable({
                    url: '/dalr/api/queryDRg',
                    contentType: "application/json; charset=UTF-8",
                    type: "GET",
                    dataType: 'json',
                    queryParamsType: "",
                    sortName : 'rgsj',
                    sortOrder : 'desc',
                    singleSelect: true,
                    paginationShowPageGo: true,
                    pageNumber:1,
                    pageSize:5,
                    queryParams: function (params) {
                        return {'pageNum':params.pageNumber,'pageSize':params.pageSize,'sort':params.sortOrder};
                    },
                    onPageChange:function(params){
                        pageNum = params;
                    },
                    striped: true,
                    smartDisplay:false,
                    cache: false,
                    pagination: true,
                    pageList: [5,10],
                    sidePagination: 'server',
                    //toolbar: "#addtool",
                    columns: [{
                        field: 'dabh',
                        title: '档案编号',
                        formatter:paramsMatter
                    },{
                        field: 'ajtm',
                        title: '案卷题名',
                        formatter:paramsMatter
                    }, {
                        field: 'dtslbh',
                        title: '大厅受理编号',
                        formatter:paramsMatter
                    }, {
                        field: 'jsdw',
                        title: '建设单位',
                        formatter:paramsMatter
                    },{
                        title: '操作',
                        formatter: function (value, row, index) {
                            var aStr = '<a class="czBtn" href="javascript:clxxlr(\''+row.dabh+'\','+row.id+')">信息录入</a>';
                            aStr += '<a class="czBtn" href="javascript:clsc(\''+row.dalxText+'\',\''+row.dabh+'\')">材料上传</a>';
                            aStr += '<label style="color: #777777;">|</label>';
                            aStr += '<a class="czBtn" href="javascript:tjsh('+row.id+','+row.shrId+')">入馆审核</a>';
                            aStr += '<a class="czBtn" href="javascript:zf('+row.id+')">作废</a>';
                            return aStr;
                        }
                    }],
                    responseHandler: function (res) {  //后台返回的结果
                        if (res.code == "200") {
                            var data = res.data.data;
                            var NewData = [];
                            for(i=0;i<data.length;i++){
                                var dd = data[i];
                                dd.roleName = roleId2RoleName(dd.roleId);
                                NewData.push(dd);
                            }
                            var data = {
                                total: res.data.total,
                                rows: NewData
                            };
                            return data;
                        }
                    }
                });
            }
        })
    }

    //入馆审核
    function tjsh(id,shrId) {
        if(shrId != null){
            var myMsg = cxLoad("提交中");
            $.get("/dalr/api/submitRg?id=" + id+"&userId="+shrId, function (result) {
                if (result.code == 200) {
                    layer.close(myMsg);
                    cxAlertOk("提交成功");
                    $('#shrModal').modal('hide');
                    $("#userTable").bootstrapTable('destroy');
                    $('#userTable').bootstrapTable({
                        url: '/dalr/api/queryDRg',
                        contentType: "application/json; charset=UTF-8",
                        type: "GET",
                        dataType: 'json',
                        queryParamsType: "",
                        sortName : 'rgsj',
                        sortOrder : 'desc',
                        singleSelect: true,
                        paginationShowPageGo: true,
                        pageNumber:1,
                        pageSize:5,
                        queryParams: function (params) {
                            return {'pageNum':params.pageNumber,'pageSize':params.pageSize,'sort':params.sortOrder};
                        },
                        onPageChange:function(params){
                            pageNum = params;
                        },
                        striped: true,
                        smartDisplay:false,
                        cache: false,
                        pagination: true,
                        pageList: [5,10],
                        sidePagination: 'server',
                        //toolbar: "#addtool",
                        columns: [{
                            field: 'dabh',
                            title: '档案编号',
                            formatter:paramsMatter
                        },{
                            field: 'ajtm',
                            title: '案卷题名',
                            formatter:paramsMatter
                        }, {
                            field: 'dtslbh',
                            title: '大厅受理编号',
                            formatter:paramsMatter
                        }, {
                            field: 'jsdw',
                            title: '建设单位',
                            formatter:paramsMatter
                        },{
                            title: '操作',
                            formatter: function (value, row, index) {
                                var aStr = '<a class="czBtn" href="javascript:clxxlr(\''+row.dabh+'\','+row.id+')">信息录入</a>';
                                aStr += '<a class="czBtn" href="javascript:clsc(\''+row.dalxText+'\',\''+row.dabh+'\')">材料上传</a>';
                                aStr += '<label style="color: #777777;">|</label>';
                                aStr += '<a class="czBtn" href="javascript:tjsh('+row.id+','+row.shrId+')">入馆审核</a>';
                                aStr += '<a class="czBtn" href="javascript:zf('+row.id+')">作废</a>';
                                return aStr;
                            }
                        }],
                        responseHandler: function (res) {  //后台返回的结果
                            if (res.code == "200") {
                                var data = res.data.data;
                                var NewData = [];
                                for(i=0;i<data.length;i++){
                                    var dd = data[i];
                                    dd.roleName = roleId2RoleName(dd.roleId);
                                    NewData.push(dd);
                                }
                                var data = {
                                    total: res.data.total,
                                    rows: NewData
                                };
                                return data;
                            }
                        }
                    });
                }
            });
        }else {
            $.get("listRgShUser",function (result){
                if(result.code == 200){
                    vue.$data.shrs = result.data;
                    $('#shrModal').modal('show');
                    vue.$data.id = id;
                }
            });
        }
    }

    var vue = new Vue({
        el:'#lxgl',
        data:{
            id:null,
            shr:null,//审核人
            shrs:null,//审核人们
            kjlx:0,//判断为哪种科技档案类型,0为通用类型，1为个人住房
            dalxText:null,
            zzsc:false,
            upLoadFiles:null,
            files:null,
            scsmyj:{
                yjmc:null,
            },
            iskj:true,
            dalxId:null,
            isopen1:true,
            isopen2:false,
            parentLx:null,
            dalx:null,
            sc:"disabled",
            gdxx:{
                lb:null,
                dalxText:null,
                typeName:null,//
                id:null,
                typeId:null,//
                dabh:null,
                xmbh:null,
                xmmc:null,
                year:null,
                dtslbh:null,//大厅受理编号
                yhh:null,//原盒号
                jsdw:null,//建设单位
                jswz:null,//建设位置
                jsxmxzyjssj:null,//建设项目选址意见书时间
                xzxmmc:null,//选址项目名称
                xzydmj:null,//选址用地面积
                jsydghxkzsj:null,//建设用地规划许可证时间
                ghxmmc:null,//规划项目名称
                ghydmj:null,//规划用地面积
                jsgcghxkzsj:null,//建设工程规划许可证时间
                gcxmmc:null,//工程项目名称
                gcjsgm:null,//工程建设规模
                jsgcjgghyshgsj:null,//建设工程竣工规划验收合格证时间
                gcjgxmmc:null,//工程竣工项目名称
                gcjgjsgm:null,//工程竣工建设规模
                jsgcsgxkzsj:null,//建设工程施工许可证时间
                jsgcsgxkzbh:null,//建设工程施工许可证编号
                sggcmc:null,//施工工程名称
                sgjsgm:null,//施工建设规模
                qt:null,//其他
                xmfatgsj:null,//项目通过时间
                ys:null,//页数
                daccwz:null,//档案存储位置
                clj:null,//超链接
                zly:null,//著录员
                zlsj:null,//著录时间
                bz:null,//备注

            },
            clxx:{
                slsj:null,
                typeName:null,
                clmc:null,
                otherZh:null,
                dabh:null,
                typeId:null,
                wjxh:"001",
                //clmc:null,
                fs:null,
                qsym:null,
                zzym:null,
                ys:null,
                year:null,
                otherZh:null,
                bz:null
            }
        },
        methods:{
            //确认选择审批人
            sureSelect:function(){
                var userId = this.shr;
                var myMsg = cxLoad("提交中");
                $.get("/dalr/api/submitRg?id=" + this.id+"&userId="+userId, function (result) {
                    if (result.code == 200) {
                        layer.close(myMsg);
                        cxAlertOk("提交成功");
                        $('#shrModal').modal('hide');
                        $("#userTable").bootstrapTable('destroy');
                        $('#userTable').bootstrapTable({
                            url: '/dalr/api/queryDRg',
                            contentType: "application/json; charset=UTF-8",
                            type: "GET",
                            dataType: 'json',
                            queryParamsType: "",
                            sortName : 'rgsj',
                            sortOrder : 'desc',
                            singleSelect: true,
                            paginationShowPageGo: true,
                            pageNumber:1,
                            pageSize:5,
                            queryParams: function (params) {
                                return {'pageNum':params.pageNumber,'pageSize':params.pageSize,'sort':params.sortOrder};
                            },
                            onPageChange:function(params){
                                pageNum = params;
                            },
                            striped: true,
                            smartDisplay:false,
                            cache: false,
                            pagination: true,
                            pageList: [5,10],
                            sidePagination: 'server',
                            //toolbar: "#addtool",
                            columns: [{
                                field: 'dabh',
                                title: '档案编号',
                                formatter:paramsMatter
                            },{
                                field: 'ajtm',
                                title: '案卷题名',
                                formatter:paramsMatter
                            }, {
                                field: 'dtslbh',
                                title: '大厅受理编号',
                                formatter:paramsMatter
                            }, {
                                field: 'jsdw',
                                title: '建设单位',
                                formatter:paramsMatter
                            },{
                                title: '操作',
                                formatter: function (value, row, index) {
                                    var aStr = '<a class="czBtn" href="javascript:clxxlr(\''+row.dabh+'\','+row.id+')">信息录入</a>';
                                    aStr += '<a class="czBtn" href="javascript:clsc(\''+row.dalxText+'\',\''+row.dabh+'\')">材料上传</a>';
                                    aStr += '<label style="color: #777777;">|</label>';
                                    aStr += '<a class="czBtn" href="javascript:tjsh('+row.id+','+row.shrId+')">入馆审核</a>';
                                    aStr += '<a class="czBtn" href="javascript:zf('+row.id+')">作废</a>';
                                    return aStr;
                                }
                            }],
                            responseHandler: function (res) {  //后台返回的结果
                                if (res.code == "200") {
                                    var data = res.data.data;
                                    var NewData = [];
                                    for(i=0;i<data.length;i++){
                                        var dd = data[i];
                                        dd.roleName = roleId2RoleName(dd.roleId);
                                        NewData.push(dd);
                                    }
                                    var data = {
                                        total: res.data.total,
                                        rows: NewData
                                    };
                                    return data;
                                }
                            }
                        });
                    }
                });
            },
            closeshr:function(){
                $('#shrModal').modal('hide');
            },
            doUploadFiles:function(){
                dabh = this.clxx.dabh;
                //dalx = this.dalxText;
                //this.clxx.typeName = dalx;
                //this.clxx.typeId = typeId;
                if(this.clxx.dabh == null){
                    cxAlert("档案类型不能为空");
                    return;
                }
                if(this.files == null || this.files.length==0){
                    cxAlert("请选择要上传的文件夹");
                    return;
                }
                var data = new FormData();
                data.append('lb',this.dalxText);
                data.append('dah', this.clxx.dabh);
                for (var i = 0; i < this.files.length; i++) {
                    data.append('files', this.files[i])
                }
                this.zzsc = false;
                var myMsg = cxLoad("上传中");
                this.$http.post('/api/upload/upLoadClxx', data, {
                    headers: {
                        'Content-Type': 'multipart/form-data',
                    },
                }).then(res => {
                    this.zzsc = true;
                    var data = res.body;
                    if(data.code == "200"){
                        layer.close(myMsg);
                        this.zzsc = false;
                        typeName = this.clxx.typeName;
                        typeId = this.clxx.typeId;
                        cxAlertOk("文件夹上传成功");
                        $('#filesModal').modal('hide');
                        $("form").data('bootstrapValidator').resetForm();//清除当前验证的关键之处
                        Object.keys(this.clxx).forEach(key => (this.clxx[key] = null));
                        this.parentLx=null;
                        //this.dalx=null;
                        //this.dalxText = null;
                        this.clxx.dabh = dabh;
                        this.clxx.typeName = typeName;
                        this.clxx.typeId = typeId;
                        $("#clTable").bootstrapTable('destroy');
                        $('#clTable').bootstrapTable({
                            url: '/dalr/api/queryDabhClxx?dabh='+this.clxx.dabh,
                            contentType: "application/json; charset=UTF-8",
                            type: "GET",
                            dataType: 'json',
                            queryParamsType: "",
                            singleSelect: true,
                            paginationShowPageGo: true,
                            pageNumber:1,
                            pageSize:8,
                            queryParams: function (params) {
                                return {'pageNum':params.pageNumber,'pageSize':params.pageSize};
                            },
                            striped: true,
                            smartDisplay:false,
                            cache: false,
                            //pagination: true,
                            //pageList: [8],
                            sidePagination: 'server',
                            //toolbar: "#addtool",
                            columns: [
                                {
                                    title: '档案类型',
                                    field:'typeName',
                                    formatter:paramsMatter
                                },{
                                    field: 'dabh',
                                    title: '档案编号',
                                    formatter:paramsMatter
                                },
                                {
                                    title: '文件序号',
                                    field:'wjxh',
                                    formatter:paramsMatter
                                },{
                                    field: 'clxxName',
                                    title: '材料名称',
                                    formatter:paramsMatter
                                }],
                            responseHandler: function (res) {  //后台返回的结果
                                if (res.code == "200") {
                                    var data = res.data;
                                    var NewData = [];
                                    for(i=0;i<data.length;i++){
                                        var dd = data[i];
                                        NewData.push(dd);
                                    }
                                    var data = {
                                        total: res.data.total,
                                        rows: NewData
                                    };
                                    return data;
                                }
                            }
                        });
                    }else{
                        layer.close(myMsg);
                        this.zzsc = false;
                        cxAlert(data.mess);
                    }

                }).catch(err => {
                    layer.close(myMsg);
                    this.zzsc = false;
                    console.log(err);
                });
            },
            filesChange:function(){
                this.upLoadFiles = [];
                this.files = [];
                this.scsmyj.yjmc=[];
                var temp = [];
                this.upLoadFiles = [];
                var fileUpload = this.$refs.fileUpload;
                var file = fileUpload.files;
                var tempFile=[];
                for(i = 0; i < file.length; i++){
                    var f = file[i];
                    tempFile.push(f);
                    // if(f.name.toLowerCase().indexOf(".jpg") != -1 || f.name.toLowerCase().indexOf(".png") != -1 || f.name.toLowerCase().indexOf(".bmp") != -1 || f.name.toLowerCase().indexOf(".pdf") != -1){
                    //
                    // }
                }
                this.files = tempFile;
                //this.gdxx.zys = tempFile.length;
                for (i = 0; i < tempFile.length; i++) {
                    var f = tempFile[i];
                    var path = f.webkitRelativePath;
                    data={};
                    data['id']=i+1;
                    var lastPath = path.lastIndexOf("/");
                    var lastPath2= path.substring(0,lastPath).lastIndexOf("/");
                    if(lastPath2){
                        data['yjmc'] = path.substring(lastPath2+1,lastPath);
                        temp.push(path.substring(lastPath2+1,lastPath));
                    }else {
                        temp.push(path.substring(0,path.lastIndexOf("/")));
                    }
                    //this.clxx.dabh = path.substring(0,path.indexOf("/"));
                    data['wjmc'] = f.name;
                    this.upLoadFiles.push(data);
                    this.scsmyj.yjmc = data['yjmc'];
                }
                this.scsmyj.yjmc = temp;
                //this.doUploadFiles();
            },
            kjtab:function(){
                this.iskj = true;
            },
            wstab:function(){
                this.iskj = false;
            },
            //判断打开哪种科技类型
            kjlxClick:function(){
                if(this.kjlx === 0){
                    top.addTabs({
                        id: "19001115",
                        text: "档案录入",
                        icon: "fa fa-tasks",
                        url: "kjdalr",
                        targetType: "iframe-tab",
                        close:true,
                    });
                    $("#selectModal").modal("hide");
                }else {
                    //打开个人住房录入
                    top.addTabs({
                        id: "190011151",
                        text: "档案录入",
                        icon: "fa fa-tasks",
                        url: "gryflr",
                        targetType: "iframe-tab",
                        close:true,
                    });
                    $("#selectModal").modal("hide");
                }
            },
            daxxlr:function(){
                if(this.iskj){
                    $("#selectModal").modal("show");
                }else {
                    top.addTabs({
                        id: "19001116",
                        text: "档案录入",
                        icon: "fa fa-tasks",
                        url: "wsdalr",
                        targetType: "iframe-tab",
                        close:true,
                    });
                }
            },
            sureLxSelect:function(){
                if (vue.$data.dalxId == 9){
                    vue.$data.isopen1 = false;
                    vue.$data.isopen2 = true;
                }else{
                    vue.$data.isopen1 = true;
                    vue.$data.isopen2 = false;
                }
                //console.log(vue.$data.isopen1);
                $('#lxxzModal').modal('hide');
            },
            close:function(){
                $('#lxxzModal').modal('hide');
            },
        },
        mounted:function () {
            var url = location.search;
            var str;
            if(url.indexOf("?") === -1){
                str = {'pageNum':pageNum,'pageSize':pageSize,'sort':sortOrder};
                $("#userTable").bootstrapTable('destroy');
                $('#userTable').bootstrapTable({
                    url: '/dalr/api/queryDRg',
                    contentType: "application/json; charset=UTF-8",
                    type: "GET",
                    dataType: 'json',
                    queryParamsType: "",
                    sortName : 'rgsj',
                    sortOrder : 'desc',
                    singleSelect: true,
                    paginationShowPageGo: true,
                    pageNumber:1,
                    pageSize:5,
                    queryParams: function (params) {
                        return {'pageNum':params.pageNumber,'pageSize':params.pageSize,'sort':params.sortOrder};
                    },
                    onPageChange:function(params){
                        pageNum = params;
                    },
                    striped: true,
                    smartDisplay:false,
                    cache: false,
                    pagination: true,
                    pageList: [5,10],
                    sidePagination: 'server',
                    //toolbar: "#addtool",
                    columns: [{
                        field: 'dabh',
                        title: '档案编号',
                        formatter:paramsMatter
                    },{
                        field: 'ajtm',
                        title: '案卷题名',
                        formatter:paramsMatter
                    }, {
                        field: 'dtslbh',
                        title: '大厅受理编号',
                        formatter:paramsMatter
                    }, {
                        field: 'jsdw',
                        title: '建设单位',
                        formatter:paramsMatter
                    },{
                        title: '操作',
                        formatter: function (value, row, index) {
                            var aStr = '<a class="czBtn" href="javascript:clxxlr(\''+row.dabh+'\','+row.id+')">信息录入</a>';
                            aStr += '<a class="czBtn" href="javascript:clsc(\''+row.dalxText+'\',\''+row.dabh+'\')">材料上传</a>';
                            aStr += '<label style="color: #777777;">|</label>';
                            aStr += '<a class="czBtn" href="javascript:tjsh('+row.id+','+row.shrId+')">入馆审核</a>';
                            aStr += '<a class="czBtn" href="javascript:zf('+row.id+')">作废</a>';
                            return aStr;
                        }
                    }],
                    responseHandler: function (res) {  //后台返回的结果
                        if (res.code == "200") {
                            var data = res.data.data;
                            var NewData = [];
                            for(i=0;i<data.length;i++){
                                var dd = data[i];
                                dd.roleName = roleId2RoleName(dd.roleId);
                                NewData.push(dd);
                            }
                            var data = {
                                total: res.data.total,
                                rows: NewData
                            };
                            return data;
                        }
                    }
                });
            }else {
                var num = url.substring(0,url.indexOf("&"));
                num = num.substring(num.indexOf("=")+1);
                var url2 = url.substring(url.indexOf("&")+1);
                var size = url2.substring(url2.indexOf("=")+1);
                if(num == "undefined"){
                    str = {'pageNum':pageNum,'pageSize':pageSize,'sort':sortOrder};
                    $("#userTable").bootstrapTable('destroy');
                    $('#userTable').bootstrapTable({
                        url: '/dalr/api/queryDRg',
                        contentType: "application/json; charset=UTF-8",
                        type: "GET",
                        dataType: 'json',
                        queryParamsType: "",
                        sortName : 'rgsj',
                        sortOrder : 'desc',
                        singleSelect: true,
                        paginationShowPageGo: true,
                        pageNumber:1,
                        pageSize:5,
                        queryParams: function (params) {
                            return {'pageNum':params.pageNumber,'pageSize':params.pageSize,'sort':params.sortOrder};
                        },
                        onPageChange:function(params){
                            pageNum = params;
                        },
                        striped: true,
                        smartDisplay:false,
                        cache: false,
                        pagination: true,
                        pageList: [5,10],
                        sidePagination: 'server',
                        //toolbar: "#addtool",
                        columns: [{
                            field: 'dabh',
                            title: '档案编号',
                            formatter:paramsMatter
                        },{
                            field: 'ajtm',
                            title: '案卷题名',
                            formatter:paramsMatter
                        }, {
                            field: 'dtslbh',
                            title: '大厅受理编号',
                            formatter:paramsMatter
                        }, {
                            field: 'jsdw',
                            title: '建设单位',
                            formatter:paramsMatter
                        },{
                            title: '操作',
                            formatter: function (value, row, index) {
                                var aStr = '<a class="czBtn" href="javascript:clxxlr(\''+row.dabh+'\','+row.id+')">信息录入</a>';
                                aStr += '<a class="czBtn" href="javascript:clsc(\''+row.dalxText+'\',\''+row.dabh+'\')">材料上传</a>';
                                aStr += '<label style="color: #777777;">|</label>';
                                aStr += '<a class="czBtn" href="javascript:tjsh('+row.id+','+row.shrId+')">入馆审核</a>';
                                aStr += '<a class="czBtn" href="javascript:zf('+row.id+')">作废</a>';
                                return aStr;
                            }
                        }],
                        responseHandler: function (res) {  //后台返回的结果
                            if (res.code == "200") {
                                var data = res.data.data;
                                var NewData = [];
                                for(i=0;i<data.length;i++){
                                    var dd = data[i];
                                    dd.roleName = roleId2RoleName(dd.roleId);
                                    NewData.push(dd);
                                }
                                var data = {
                                    total: res.data.total,
                                    rows: NewData
                                };
                                return data;
                            }
                        }
                    });
                }else {
                    str = {'pageNum':num,'pageSize':size,'sort':sortOrder};
                    $("#userTable").bootstrapTable('destroy');
                    $('#userTable').bootstrapTable({
                        url: '/dalr/api/queryDRg',
                        contentType: "application/json; charset=UTF-8",
                        type: "GET",
                        dataType: 'json',
                        queryParamsType: "",
                        sortName : 'rgsj',
                        sortOrder : 'desc',
                        singleSelect: true,
                        paginationShowPageGo: true,
                        pageNumber:1,
                        pageSize:5,
                        queryParams: function (params) {
                            return str;
                        },
                        onPageChange:function(params){
                            pageNum = params;
                        },
                        striped: true,
                        smartDisplay:false,
                        cache: false,
                        pagination: true,
                        pageList: [5,10],
                        sidePagination: 'server',
                        //toolbar: "#addtool",
                        columns: [{
                            field: 'dabh',
                            title: '档案编号',
                            formatter:paramsMatter
                        },{
                            field: 'ajtm',
                            title: '案卷题名',
                            formatter:paramsMatter
                        }, {
                            field: 'dtslbh',
                            title: '大厅受理编号',
                            formatter:paramsMatter
                        }, {
                            field: 'jsdw',
                            title: '建设单位',
                            formatter:paramsMatter
                        },{
                            title: '操作',
                            formatter: function (value, row, index) {
                                var aStr = '<a class="czBtn" href="javascript:clxxlr(\''+row.dabh+'\','+row.id+')">信息录入</a>';
                                aStr += '<a class="czBtn" href="javascript:clsc(\''+row.dalxText+'\',\''+row.dabh+'\')">材料上传</a>';
                                aStr += '<label style="color: #777777;">|</label>';
                                aStr += '<a class="czBtn" href="javascript:tjsh('+row.id+','+row.shrId+')">入馆审核</a>';
                                aStr += '<a class="czBtn" href="javascript:zf('+row.id+')">作废</a>';
                                return aStr;
                            }
                        }],
                        responseHandler: function (res) {  //后台返回的结果
                            if (res.code == "200") {
                                var data = res.data.data;
                                var NewData = [];
                                for(i=0;i<data.length;i++){
                                    var dd = data[i];
                                    dd.roleName = roleId2RoleName(dd.roleId);
                                    NewData.push(dd);
                                }
                                var data = {
                                    total: res.data.total,
                                    rows: NewData
                                };
                                return data;
                            }
                        }
                    });
                }
            }
        }
    });
</script>

</body>
</html>
